package com.hkbigdata.sybx.service.ipml;


import com.hkbigdata.sybx.bean.ServiceEvaluation;
import com.hkbigdata.sybx.mapper.ServiceEvaluationMapper;
import com.hkbigdata.sybx.service.ServiceEvaluationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuanbo
 * @creat 2025-05-31-22:09
 * @see 2194550857@qq.com
 */
@Service
public class ServiceEvaluationServiceImpl implements ServiceEvaluationService {
    @Autowired
    private ServiceEvaluationMapper serviceEvaluationMapper;
    @Override
    public boolean ServiceEvaluationInert(ServiceEvaluation serviceEvaluation) {
        int i = serviceEvaluationMapper.insertServiceEvaluation(serviceEvaluation);
        if (i > 0) {
            return true;
        }
        return false;
    }

    @Override
    public Boolean ServiceEvaluationSelect(Long userId) {
        ServiceEvaluation evaluation = serviceEvaluationMapper.selectServiceEvaluation(userId);
        return evaluation != null;
    }

    @Override
    public List<ServiceEvaluation> ServiceEvaluationSelect() {
        List<ServiceEvaluation> evaluations = serviceEvaluationMapper.ServiceEvaluationsEvaluation();
        return evaluations;
    }

    @Override
    public boolean deleteByUserId(String userId) {
        int i = serviceEvaluationMapper.deleteByUserId(userId);
        return i > 0;
    }
}
